<template>
    <div class="body">
        <!-- @touchend="touchend" @click="clickDate"  -->
        <vue-hash-calendar class="hashDate" :mark="markDate" :visible="true" @change="dateChange" :isShowToday="true" :isShowWeekView="true" :showTodayButton="false" :defaultDatetime="defaultDatetime" @today="todayFn">
        </vue-hash-calendar>
    </div>
</template>

<script>

export default {
    name: 'demo',
    data() {
        return {
            defaultDatetime: new Date(),
            markDate: {
                '2021/05/06': ["am", "pm"]
            }
        }
    },
    mounted() {
        setTimeout(() => {
            this.markDate = {
                '2021/05/06': ["am", "pm"],
                '2021/05/05': ["am", "pm"],
                '2021/05/07': ["am", "pm"]
            }
        }, 10000)
        // this.defaultDatetime = new Date('2019-06-01 19:04');
    },
    methods: {
        dateChange(date) { // 日期改变触发
            console.log(date, 'change')
        },
        todayFn() {
            console.log(111)
        }
    }
}
</script>
<style>
* {
    padding: 0;
    margin: 0;
}
</style>